import PAGE from "../../../utils/middleware/page";
import { storeBindingsBehavior } from "mobx-miniprogram-bindings";
import store from "../../../store/index";
const app = getApp();
Page(PAGE({
    behaviors: [storeBindingsBehavior],
    storeBindings: {
        store,
        fields: {
            needRefresh: 'vehicle.needRefresh'
        },
        actions: {
            updateNeedRefresh: 'vehicle.updateNeedRefresh'
        }
    },
    data: {
        loginUserInfo: {},
        apiField: {
            module: "member",
            api: "GetLoginUser",
            data: "loginUserInfo",
            search: {},
        },
    },
    onLoad() {
        this.fetchData();
    },
    onShow() {
        if (this.data.needRefresh) {
            // this.updateNeedRefresh(false);
            this.fetchData();
        }
    },
    onPullDownRefresh() {
        this.fetchData();
        wx.stopPullDownRefresh();
    },
    async fetchData() {
        this.handleFetchData({}, "apiField", true);
    },
}));